import Vue from 'vue'
import Vuex from 'vuex'
import { setItem, getItem, removeItem } from '@/utils/storage'
Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        user: getItem('USERINFO'),


    },
    mutations: {
        setUser(state, data) {
            state.user = data
            setItem('USERINFO', data)
        },
        quit(state) {
            state.user = null
            removeItem('USERINFO')
        },

    },
    actions: {},
    modules: {}
})